package com.xmhmyh.generalframework.framework.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@MapperScan(
        {
            "com.xmhmyh.generalframework.project.sys.mapper",
            "com.xmhmyh.generalframework.project.systool.mapper",
            "com.xmhmyh.generalframework.project.basis.mapper",
            "com.xmhmyh.generalframework.project.ser.mapper",
            "com.xmhmyh.generalframework.framework.quartz.mapper",
            "com.xmhmyh.generalframework.project.fin.mapper",
            "com.xmhmyh.generalframework.project.bus.mapper",
        })
public class MybatisPlusConfig {

    /**
     * mybatis-plus分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        paginationInterceptor.setDialectType(DbType.MYSQL.getDb());
        return paginationInterceptor;
    }
}
